from sentence_transformers import SentenceTransformer
from config import LOCAL_MODEL_DIR
import logging
def init_model() -> SentenceTransformer:
    """初始化文本向量化模型"""
    try:
        model = SentenceTransformer(LOCAL_MODEL_DIR)
        logging.info(f"成功加载模型: {LOCAL_MODEL_DIR}")
        return model
    except Exception as e:
        logging.error(f"加载模型失败: {str(e)}")